/**
 * @Date 2023-02-21 09:42:02
 * @Remark
 */

// lib
// import _ from "lodash";
// config
// script & methods & public
// import logUtils from "utils/logUtils";
// state
// import { dataState } from "state/global";
// http
// import { open, bag, isOkRes } from "public/http/api";
// service
import {
  simpleListService,
  simplePageService,
  simpleResService,
} from "public/service/simple.service";
// api
import {
  API_SHOP_PAGE,
  ReqShopPage,
  API_SHOP_ADD,
  ReqShopAddPage,
  API_SHOP_EDIT,
  API_SHOP_DELETE,
  API_SHOP_CHANGESTATUS,
  ReqShopChangeStatus,
  API_SHOP_NO_PAGE,
} from "./api";
// interface
// 其它

// 店铺分页
export async function getShopPageService(params: ReqShopPage) {
  return simplePageService<ReqShopPage, ShopDto>(API_SHOP_PAGE, params);
}

// 店铺不分页
export async function getShopNoPageService() {
  return await simpleListService<any, any>(API_SHOP_NO_PAGE, {});
}

// 店铺添加
export async function addShopService(params: ReqShopAddPage) {
  return simpleResService<ReqShopAddPage>(API_SHOP_ADD, params);
}

// 店铺修改
export async function editShopService(params: ReqShopAddPage) {
  return simpleResService<ReqShopAddPage>(API_SHOP_EDIT, params);
}

// 店铺删除
export async function deleteShopService(params: ReqShopAddPage) {
  return simpleResService<ReqShopAddPage>(API_SHOP_DELETE, params);
}

// 修改店铺状态
export async function changeStatusShopService(params: ReqShopChangeStatus) {
  return simpleResService<ReqShopChangeStatus>(API_SHOP_CHANGESTATUS, params);
}
